package com.ewing.common.utils;

import com.ewing.utils.PropertyUtils;

/**
 * 系统的一些参数的设置
 * 
 * @author Joeson Chan<chenxuegui1234@163.com>
 * @since 2016年2月13日
 */
public class SystemPropertyUtils {


  private final static String CUSTOMER_LOGIN_VALIDATE =
      PropertyUtils.getProperty("customer.validatelogin.open");


  // 资源库图片站点
  private final static String RESOURCE_WEBSTIE = PropertyUtils.getProperty("resource.website");

  /** 快递查询接口调用的appid **/
  private final static String EXPRESS_APPID = PropertyUtils.getProperty("express_appid");

  /** 商店站点 **/
  private final static String SHOP_DOMAIN = PropertyUtils.getProperty("shop.domain");

  private static final String CROSS_DOMAIN = PropertyUtils.getProperty("cross.domain");


  /*************************** 短信服务接入 ******************/
  private static final String SMS_SERVER_URL = PropertyUtils.getProperty("sms.server.url");

  private static final String SMS_SERVER_APPKEY = PropertyUtils.getProperty("sms.server.appkey");

  private static final String SMS_SERVER_SECRET = PropertyUtils.getProperty("sms.server.secret");

  private static final String SMS_FREE_SIGN_NAME = PropertyUtils.getProperty("sms.free.sign.name");

  private static final String SMS_PRODUCT = PropertyUtils.getProperty("sms.product");

  private static final String SMS_VALID_CHECK = PropertyUtils.getProperty("sms.valid.check");

  private static final String SMS_VALID_ALLOW = PropertyUtils.getProperty("sms.valid.allow");
  
  
  public static String getResourceWebsite(){
    return RESOURCE_WEBSTIE;
  }
  public static String getCrossDomain(){
    return CROSS_DOMAIN;
  }
  public static String getSmsServerUrl(){
    return SMS_SERVER_URL;
  }
  public static String getSmsServerAppKey(){
    return SMS_SERVER_APPKEY;
  }
  public static String getSmsServerSecret(){
    return SMS_SERVER_SECRET;
  }
  public static String getSmsFreeSignName(){
    return SMS_FREE_SIGN_NAME;
  }
  public static String getSmsProduct(){
    return SMS_PRODUCT;
  }


  public static String getExpressId(){
    return EXPRESS_APPID;
  }

  /** 是否需要验证登陆状态 **/
  public static boolean needAuth() {
    return Boolean.valueOf(CUSTOMER_LOGIN_VALIDATE);
  }

  /**
   * 是否是开发模式<br/>
   * 验证是否需要登陆验证，如果不需要登陆验证，就认为是开发模式；如果不是开发模式，就是生产模式
   * 
   * @author Joeson
   */
  public static boolean isDev() {
    return !Boolean.valueOf(CUSTOMER_LOGIN_VALIDATE);
  }

  public static boolean getSmsValidCheck() {
    return Boolean.valueOf(SMS_VALID_CHECK);
  }

  public static String getSmsValidAllow() {
    return SMS_VALID_ALLOW;
  }

  public static String getShopDomain() {
    return SHOP_DOMAIN;
  }
}
